package com.vcredit.creditcat.model.base;

import java.text.ParseException;
import java.util.Calendar;

import org.apache.commons.lang.StringUtils;

import com.vcredit.creditcat.util.ConcurrentDateUtil;


public abstract class AbstractItem {
	
	private Integer itemCode; // 认证项code

	private String expiredTime;
	
	public abstract int getStatus();
	
	public String getExpiredTime() {
		return expiredTime;
	}

	public void setExpiredTime(String expiredTime) {
		this.expiredTime = expiredTime;
	}
	
	public Integer getItemCode() {
		return itemCode;
	}

	public void setItemCode(Integer itemCode) {
		this.itemCode = itemCode;
	}

	public boolean computeExpire() throws ParseException{
		if(StringUtils.isEmpty(this.expiredTime)){
			return false;
		}
		Calendar cal = Calendar.getInstance();
		long now = cal.getTimeInMillis();
		long expire = ConcurrentDateUtil.strToDate(this.expiredTime).getTime();
		if(expire<now){
			return true;
		}
		return false;
	}
}
